#ifndef __IO_3DS_H__
#define __IO_3DS_H__

#include "utils/singleton.h"
#include "io/zipfile.h"

class IO3ds : public Singleton<IO3ds>
{
public:
	IO3ds();
	~IO3ds();

	// Open a *.3ds file
	Lib3dsFile* FileOpen(string strFile);

	// Close a *.3ds file
	void FileClose(Lib3dsFile* pFile);

	// Read any file's data
	size_t ReadFile(string strFile, byte* buffer, size_t size);

private:
	static long SeekFunc(void *self, long offset, Lib3dsIoSeek origin);
	static long TellFunc(void *self);
	static size_t ReadFunc(void *self, void *buffer, size_t size);
	static size_t WriteFunc(void *self, const void *buffer, size_t size);

private:
	ZipFile m_zipFile;
	Lib3dsIo m_io;
};

#endif